package hlhj.fhp.supreme.activitys

import android.app.Activity
import android.support.v7.app.AppCompatActivity
import android.os.Bundle
import android.support.v4.app.Fragment
import android.support.v7.widget.LinearLayoutManager
import android.widget.LinearLayout
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.lzy.okgo.OkGo
import com.lzy.okgo.model.Response
import fhp.hlhj.giantfold.utils.ToastUtils
import hlhj.fhp.supreme.BaseAty
import hlhj.fhp.supreme.R
import hlhj.fhp.supreme.adapters.JiePanPagerAdp
import hlhj.fhp.supreme.fragment.SpendHisFgm
import hlhj.fhp.supreme.javabean.SpendHisBean
import hlhj.fhp.supreme.network.Urls
import hlhj.fhp.supreme.utils.JsonCallBack
import hlhj.fhp.supreme.utils.MyUtils
import kotlinx.android.synthetic.main.activity_spend_history_aty.*
import java.util.ArrayList

class SpendHistoryAty : BaseAty() {
    override fun getContentId(): Int = R.layout.activity_spend_history_aty
    private lateinit var pagerAdp:JiePanPagerAdp

    private val fgmLists=ArrayList<Fragment>()
    override fun initView() {
        val tab1 = tabLayout.newTab()
        val tab2 = tabLayout.newTab()
        val tab3 = tabLayout.newTab()
        tabLayout.addTab(tab1)
        tabLayout.addTab(tab2)
        tabLayout.addTab(tab3)

        fgmLists.add(SpendHisFgm.getInstence("3","读书"))
        fgmLists.add(SpendHisFgm.getInstence("7","课堂"))
        fgmLists.add(SpendHisFgm.getInstence("0","其他"))
        pagerAdp= JiePanPagerAdp(fgmLists,supportFragmentManager)

        viewPager.adapter=pagerAdp

        tabLayout.setupWithViewPager(viewPager)
     /*   adp=object :BaseQuickAdapter<SpendHisBean.DataBean,BaseViewHolder>(R.layout.spendhis_item,datas){
            override fun convert(helper: BaseViewHolder?, item: SpendHisBean.DataBean?) {
                helper?.setText(R.id.itemName,item?.type.toString())
                helper?.setText(R.id.itemPrice,"￥${item?.money.toString()}")
                helper?.setText(R.id.itemTime,MyUtils.timeStampToStrYMD(item?.create_time!!.toLong()))
            }
        }
        adp.openLoadAnimation(BaseQuickAdapter.SLIDEIN_RIGHT)*/

    }

    override fun initData() {


    }

    override fun initListener() {
        btExit.setOnClickListener {
            finish()
        }

    }
}
